package com.tingyuge.base.design.chain;

/**
 * @Created by xiaodao
 * 总经理审批
 */
public class GeneralManageChain extends LeaderHandlerChain {


    public GeneralManageChain(String name) {
        super(name);
    }

    @Override
    public void handlerRequest(LeaveRequest request) {
        if(request.getLeaveDays() <=30){
            System.out.println("员工 "+ name +" request leave days is "+ request.getLeaveDays() +"天 请假原因 is "+ request.getReason());
            System.out.println("GeneralManageChain  " +this.name +" approved");
        }else{
            if(this.nextLeader !=null){
                this.nextLeader.handlerRequest(request);
            }
        }

    }


}



